package cl.zeke.pizzastore.vista.managedbeans;

import javax.faces.context.FacesContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("request")
public class MessagesBean {

    public boolean existenMensajesGlobales() {
        FacesContext fc = FacesContext.getCurrentInstance();
        return (fc.getMessages(null) != null) && (fc.getMessages(null).hasNext());
    }
}
